import { IParam } from '../../common';
import { IAbility } from '../../modules';
import { IViewActionResult } from '../data-action';

/**
 * 视图能力
 *
 * @export
 * @interface IViewAbility
 * @extends {IAbility}
 */
export interface IViewAbility extends IAbility {
	/**
	 * 关闭视图
	 *
	 * @memberof IViewAbility
	 */
	closeView(): void;

	/**
	 * 刷新视图
	 *
	 * @memberof IViewAbility
	 */
	refresh(args?: IParam): Promise<boolean>;

	/**
	 * 加载视图
	 *
	 * @memberof IViewAbility
	 */
	load(args?: IParam): Promise<IViewActionResult>;

	/**
	 * 保存视图
	 *
	 * @memberof IViewAbility
	 */
	save(args?: IParam): void;

	/**
	 * 获取布局面板模型对象
	 *
	 * @memberof IViewAbility
	 */
	getLayoutModelDetails(): IParam;

	/**
	 * 处理面板值改变
	 *
	 * @memberof IViewAbility
	 */
	handlePanelValueChange(name: string, value: any, index?: number): void;
}
